import time


def fbis(num):
    ret = [0, 1]
    for i in range(num - 2):
        ret.append(ret[-2] + ret[-1])
        # ret.append(ret[i] + ret[i+1])

    return ret


def main():
    ret = fbis(10)
    fobj = open('ret.txt', 'w+')
    for i, num in enumerate(ret):
        print("index %d is %d " % (i, num))
        fobj.write("%d" % num)
        time.sleep(1)


if __name__ == '__main__':
    main()
